/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package gov.police.diary.dao.impl;

import gov.police.diary.dao.CustomHibernateDaoSupport;
import gov.police.diary.dao.DepartmentDao;
import gov.police.diary.model.PolDepartment;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

/**
 *
 * @author nmduc
 */
@Repository("DepartmentDao")
@Transactional
public class DepartmentDaoImpl extends CustomHibernateDaoSupport implements DepartmentDao {

    public PolDepartment getDepartment(long id) {
        return getHibernateTemplate().get(PolDepartment.class, id);
    }

    public void saveDepartment(PolDepartment department) {
        getHibernateTemplate().save(department);
    }

    public void deleteDepartment(PolDepartment department) {
        getHibernateTemplate().delete(department);
    }

    public void updateDepartment(PolDepartment department) {
        getHibernateTemplate().update(department);
    }

}
